*JOP REPLICATION:  "Who's At The Party?" QUALTRICS 2018 EXPERIMENT

use "JOP_KMW_Qualtrics_Experiment.dta"

******************
*Identity Scale Reliability
******************

*Democrats
alpha revwatpPID1d watpPID2d revwatpPID3d watpPID4d, item

*Republicans
alpha revwatpPID1r watpPID2r revwatpPID3r watpPID4r, item

******************
*Figure 4 Results
******************
	
	*Top panel
mean IdentityDV if religion!=3, over(ExpConds_inpartyoutparty)
estimates store expresults_nonCath

coefplot expresults_nonCath, vertical recast(bar) barwidth(0.5) fcolor(*.5) levels(95 83) ///
 scheme(plotplain) ytitle("Partisan Identity Strength")
 *Note:  Additional edits made using Graph Editor
 
 *Significant difference between two treatments
reg IdentityDV i.ExpConds_inpartyoutparty if religion!=3
test 1.ExpConds_inpartyoutparty = 2.ExpConds_inpartyoutparty
 
	*Bottom panel
mean AboveMEDIANIdentity_nonCath if ExpConds_inpartyoutparty>=1 & Catholic==0, over(ExpConds_inpartyoutparty) 
estimates store aboveavgid_noncath
coefplot aboveavgid_noncath, vertical recast(bar) barwidth(0.5) fcolor(*.5) levels(95 83) ///
scheme(plotplain) ytitle("Proportion Above Median Partisan Identity Strength")
 *Note:  Additional edits made using Graph Editor
 
		*z test of significant difference
prtest AboveMEDIANIdentity_nonCath if ExpConds_inpartyoutparty>=1 & Catholic==0, by(ExpConds_inpartyoutparty) 


 
************************************************************************
 *Analyses including Catholics (Supplemental Appendix F, Figure F1)
************************************************************************

	*Top panel
mean IdentityDV, over(ExpConds_inpartyoutparty)
estimates store expresults_Cath

coefplot expresults_Cath, vertical recast(bar) barwidth(0.5) fcolor(*.5) levels(95 83) ///
 scheme(plotplain) ytitle("Partisan Identity Strength")
 *Note:  Additional edits made using Graph Editor
 
  *Regression tests of significant differences
reg IdentityDV i.ExpConds_inpartyoutparty // control as baseline
test 1.ExpConds_inpartyoutparty = 2.ExpConds_inpartyoutparty // significant difference between treatments 

 
	*Bottom panel
mean AboveMEDIANIdentity if ExpConds_inpartyoutparty>=1, over(ExpConds_inpartyoutparty) 
estimates store aboveavgid
coefplot aboveavgid, vertical recast(bar) barwidth(0.5) fcolor(*.5) levels(95 83) ///
scheme(plotplain) ytitle("Proportion Above Median Partisan Identity Strength")
*Note:  Additional edits made using Graph Editor

		*z test of significant difference
prtest AboveMEDIANIdentity_nonCath if ExpConds_inpartyoutparty>=1, by(ExpConds_inpartyoutparty) 

************************************************************************
*Results for Independents (including leaners) (Reported in Supplemental Appendix)
************************************************************************
	*DV = Democratic Feeling Thermometer
		*Non-Catholics
reg watpDft b1.WATPConds if IndInclLeaner==1  & Catholic==0
		*All respondents
reg watpDft b1.WATPConds if IndInclLeaner==1  

	*DV = Republican Feeling Thermometer
		*Non-Catholics
reg watpRft b2.WATPConds if  IndInclLeaner==1 & Catholic==0
		*All respondents
reg watpRft b2.WATPConds if  IndInclLeaner==1 


******************
 *Diagnostics
******************
 *Rating the NCA by party (using control group evaluation of the NCA)
	*Excluding Catholics
 mean FT_NCA_1 if religion!=3 & WATPConds==0, over(PartyD1I2R3)
 
	*No significant difference in ratings between partisans
ttest FT_NCA_1 if religion!=3 & PartyD1I2R3!=2, by(PartyD1I2R3)

	*Including Catholics
mean FT_NCA_1, over(PartyD1I2R3)

	*NCA rating among Catholics compared to non-Catholic
mean FT_NCA_1 if Catholic==1	
tab FT_NCA_1 if Catholic==1
ttest FT_NCA_1, by(Catholic)


*Randomization check
mprobit WATPConds age i.race i.bornUS educ polint pid7 ideology income gender i.region i.religion

*Factual manipulation check
tab watpFMC WATPConds, column chi2 V

*Subjective manipulation check
	*Republican Party association
ttest watp_SMC_RepParty if WATPConds==0 | WATPConds==2, by(WATPConds) 
	*Democratic Party association
ttest watp_SMC_DemParty if WATPConds==0 | WATPConds==1, by(WATPConds) 

 *Trust the experimental article
tab watpTrust WATPConds, column chi2 V // no significant relationship with condition
